package com.dimension.controller.image;

import com.dimension.utils.JsonResultOutputUtil;
import com.dimension.vo.ImageTag;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "GetRecommendImageList", value = "/GetRecommendImageList")
public class GetRecommendImageList extends BaseImageServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer categoryId = Integer.parseInt(req.getParameter("categoryId"));

        List<ImageTag> imageTagList = imageService.getRecommendImageList(categoryId);

        JsonResultOutputUtil.outputJsonResult(resp, imageTagList);
    }
}
